﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TCPTest
{
    public enum SpaceColor { EMPTY, WHITE, BLACK };
    public class Move
    {
        public byte x, y;
        public SpaceColor color, previousColor;

        public override string ToString()
        {
            return toHexDigit(x) + toHexDigit(y) + "\r\n";
        }
        
        public Move(byte x, byte y, SpaceColor color) 
        {
            this.x = x;
            this.y = y;
            this.color = color;
        }

        public Move() { }

        public static string toHexDigit(byte num)
        {
            switch (num)
            {
                case 0: return "1";
                case 1: return "2";
                case 2: return "3";
                case 3: return "4";
                case 4: return "5";
                case 5: return "6";
                case 6: return "7";
                case 7: return "8";
                case 8: return "9";
                case 9: return "a";
                case 10: return "b";
                case 11: return "c";
                case 12: return "d";
                case 13: return "e";
                case 14: return "f";
            }
            return "";
        }

    }
}
